<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/2
 * Time: 10:39
 */
$sql = "select * from tttj.goods where h5 = 1 and dstatus = 1 and nine_part = 1";
$list = getarrrecord($sql);
$time = time();
foreach($list as $k=>$v){
//    $list[$k]['downtime'] = $v['ontime']+(86400*30);
    $downtime = $v['ontime']+(86400*30);
    if($time >= $downtime){
        $sql = "update tttj.goods set dstatus = 2 where h5 = 1 and dstatus = 1 and nine_part = 1 and id = ".$v['id'];
        exec_db($sql);
    }
}
//var_dump($list);
//$sql = "update tttj.goods set dstatus = 2 where h5 = 1 and dstatus = 1 and nine_part = 1";
//exec_db($sql);
?>